package DataStructureAndAlgorithm.AcWing_每日一题.思维题;


//链接：https://www.acwing.com/problem/content/3811/
import java.util.Scanner;

class AcWing_3808{
    //题目的意思是将n个边长为一的小正方形，重新摆放，
    //求如何将其摆放成行列之和最小的矩形
    //并求出此时的行列之和即可
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int j = 0; j < t; j++){
            int n = in.nextInt();
            int res = n + 1;//只有n行1列的情况，此时res最大，作为初始值
            for (int a = 1; a <= (n + a - 1) / a; a++){
                res = Math.min(res,a + (n + a - 1) / a);
            }
            System.out.println(res);
        }
        in.close();
    }
}